; ; UDRIVE -- test drive module ; (c) 1990 Chris Butler ; ; cbuf 2 is effectively a global buffer set all off goto top all: set all on top: video g color 3 clearscr color 15 rect 50 25 590 325 color 0 fload ibm16 rect 65 326 600 336 rect 591 40 602 336 text 90,290 "Dear Demo Disk Viewer," text 90,250 "Welcome to the MAXIMO Series 3 Test Drive!" text 90,220 "The Test Drive is a MAXIMO simulation that guides you through" text 90,205 "the Inventory scenario in the `Solutions' section of this disk." text 90,180 "The two minute Test Drive will demonstrate the clear, graphic" text 90,165 "presentation format and natural simplicity of our user interface." text 90,150 "You'll also experience the power and responsiveness of our" text 90,135 "database as it answers complex questions with ease." text 90,105 "Please press `Enter' to begin the Test Drive." text 90,75 "Sincerely," text 90,45 "PSDI" waitkey 100 note 100 10 10 waitkey color 15 clearscr setpage 0 1 pload bigpic2 1 color 15 clearscr palette 1 setupscr 1 ;pfade 0 1 pfree 1 cload 911color.clp 1 1 0 cfade 20 96,10 1 waitkey 100 pan 0 0 90 0 2 pan 90 0 700 0 60 waitkey 20 global boxllx 0 ; mod 8 = 0 global boxlly 0 global boxw 488 global boxh 115 global boxtitle " Test Drive Module" set h 17 ; key height set keycolor 11 ; keytop color in convbox = 11 (yellow) set txtboxclr 14; cyan local xoff1 13 ; offset into instr box for text panel local yoff1 65 ; see xoff local yoff2 49 local yoff3 33 local yoff4 17 color 15 clearscr resetscr pfree 1 setpage video m color 15 clearscr set entrypoint "entry_13" ; return to MASTER label905: newbgrnd "u2a.pcx" 80 40 1 1 150 9 dotext udrv1 cload u2percnt.clp 10 0 0 cload u2b.clp 11 0 0 cload u2e.clp 12 0 0 cload u2a.clp 13 0 0 cload u2r.clp 14 0 0 cload u2i.clp 15 0 0 cload u2n.clp 16 0 0 cload u2g.clp 17 0 0 label906: getcharcmd if @0==backup label906 if @0=="%" label907 beep goto label906 label907: putup 179,415 10 getcharcmd if @0==b label908 if @0=="B" label908 beep goto label907 label908: putup 189,415 11 getcharcmd if @0==e label909 if @0=="E" label909 beep goto label908 label909: putup 199,415 12 waitkey ifkey a label910 "A" label910 getcharcmd if @0==a label910 if @0=="A" label910 beep goto label909 label910: putup 207,415 13 getcharcmd if @0==r label911 if @0=="R" label911 beep goto label910 label911: putup 216,415 14 getcharcmd if @0==i label912 if @0=="I" label912 beep goto label911 label912: putup 226,415 15 getcharcmd if @0==n label913 if @0=="N" label913 beep goto label912 label913: putup 230,415 16 getcharcmd if @0==g label914 if @0=="G" label914 beep goto label913 label914: putup 240,415 17 getcharcmd if @0=="%" label915 beep goto label914 label915: putup 251,415 10 getcharcmd if @0==altn label917 beep goto label915 label917: cfree 10 11 12 13 14 15 16 17 label920: putup 0,0 2 ; restore under instr box newbgrnd "u3.pcx" 80 40 1 1 50 9 dotext udrv2 cload shilite.clp 1 0 0 ; hilited "Screens" for fcn bar label921: getcharcmd if @0==alts label925 if @0==backup label905 ifkey "ALT-S" label925 beep goto label921 label925: putup 0,0 2 ; restore waitkey 25 putup 0,0 1 ; first hilite "Screens" newbgrnd "18.pcx" 80 40 1 1 100 9 dotext udrv3 cload swu 10 1 0 ; hilite Where Used bar vers. of Screens menu label926: getcharcmd if @0==altw label935 beep goto label926 label935: putup 0,0 2 ; restore waitkey 25 putup 400,289 10 ; hilite Where Used cfree 10 newbgrnd "19.pcx" 80 0 1 1 200 9 ; Where Used screen dotext udrv4 label936: getcharcmd if @0==alts label940 beep goto label936 label940: putup 0,0 2 ; restore waitkey 25 putup 0,0 1 ; hilite Screens on fcn bar newbgrnd "19s.pcx" 80 40 1 1 100 9 ; dropdown submenu dotext udrv5 cload 19alta.clp 10 1 0 ; preload hilited Alt Parts submenu label941: getcharcmd if @0==alta label945 beep goto label941 label945: putup 0,0 2 ; restore waitkey 25 putup 400,246 10 ; hilite Alt Parts cfree 10 newbgrnd "20.pcx" 80 40 1 1 200 9 ; Alt Parts scr dotext udrv6 label946: getcharcmd if @0==alts label950 beep goto label946 label950: putup 0,0 2 waitkey 25 putup 0,0 1 ; hilite Screens newbgrnd "20s.pcx" 80 40 1 1 100 9 ; drop submenu dotext udrv7 cload 20altp.clp 10 1 0 label951: getcharcmd if @0==altp label955 beep goto label951 label955: putup 0,0 2 waitkey 25 putup 400,245 10 cfree 10 newbgrnd "u4.pcx" 80 40 1 1 10 9 dotext udrv8 waitkey cfree 2 ; original under box video g color 15 clearscr setpage 0 1 pload bigpic2 1 clearscr palette 1 setupscr 1 pfree 1 cload 911color.clp 1 1 0 cfade 20 384,0 1 cload trailer.clp 1 1 0 cfade 1 920,0 1 cfree 1 pan 0 0 640 0 5 note 100 10 10 waitkey 500 rect 0 0 640 179 pan 640 0 1279 0 5 color 15 clearscr resetscr setpage video m if @all==on link roi.txt all else LINK MASTER.TXT entry_13 endif ---------------------------------------------------------- ; ; GETCHARCMD -- process input to conversation box ; ; uses cbuf 5 for temp getcharcmd: local bndryoff (@boxllx+417)%8 ; boundary offset local flashon "1" ; flash toggle cmdloop: waitkey; 15 nokeyyet ifkey h cmdh m cmdm s cmds left cmdb "?" cmdh "H" cmdh "S" cmds ESC cmdm ifkey "ALT-S" doalts "ALT-A" doalta "ALT-N" doaltn "ALT-P" doaltp "ALT-W" doaltw getkey thechar ; not a cmd char: return it to caller return @thechar ; gotbttn: doalta: return "alta" doaltn: return "altn" doaltp: return "altp" doalts: return "alts" doaltw: return "altw" cmdb: set bttnx @boxllx+"4" ; backup button set w "62" ; putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; "95"=y offset height for button return "backup" cmdc: set bttnx @boxllx+414 ; continue button set w "70" ;putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; return "continue" cmdh: set bttnx @boxllx+"119" ; help button set w "47" ; putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; gosub instrhelp goto cmdloop cmdm: set bttnx @boxllx+"66" ; menu button set w "53" ; putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; gosub menu_cmd goto cmdloop cmds: set bttnx @boxllx+"350" ; screen button set w "64" ; putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; screen color @keycolor goto cmdloop done: return ; subr GETCHARCMD ; ------------------------------------------ ; ; SCREEN -- temporarily remove CONVBOX from screen ; ; uses cbuf 3,4 screen: cfree 3 ; dump blank convbox cgetbuf 3 @boxllx,@boxlly @boxllx+@boxw,@boxlly+117 1 0 ; save current convbox putup 0,0 2 ; restore original convbox color 0,15 box @boxllx,@boxlly @boxllx+@boxw,@boxlly+115 2 ; outline box to replace convbox fload russell fstyle 6 2 2 text @boxllx+100,@boxlly+50 "type R to Restore" cgetbuf 4 @boxllx,@boxlly @boxllx+@boxw,@boxlly+119 1 0 ;save orig w/restore msg waitkey 50 littloop: putup 0,0 2 ifmouse 1 littlp4,,,,,, 20 littlp1 littlp1: waitkey 20 littlp2 ifkey r littlp4 "R" littlp4 ; want r/R to "restore" noise 100,1000 30 goto littlp2 littlp2: putup 0,0 4 ifmouse 1 littlp4,,,,,, 20 littlp3 littlp3: waitkey 20 littloop ifkey r littlp4 "R" littlp4 ; want r/R to "restore" noise 100,1000 30 goto littloop littlp4: putup 0,0 3 ; replace original fload ibm16 ; restore orig font fstyle 0 ; turn off shadowing return ; subr SCREEN ; -------------------------------------------- ; INSTRHELP -- putup help for instruction box ; temp uses cbuf 3 and cbuf 9 ; called from GETCMD instrhelp: convhelp: local sidemarg 3 local bottmarg 2 local rim 5 local picdim 80 local fotollx @boxllx+@rim+@sidemarg local fotolly @boxlly+@rim+@bottmarg+1 local fotourx @boxllx+@boxw-(@sidemarg+@rim+1) local fotoury @boxlly+@rim+@bottmarg+@picdim+2 local flashon 0 cgetbuf 3 @fotollx,@fotolly @fotourx,@fotoury 1 0; local txtoff (@fotollx)%8 ; boundary offset of clipping local contoff (@boxllx+417)%8 ; boundary offset of clipping color @txtboxclr rect @fotollx+1,@fotolly+1 @fotourx,@fotoury ; blank out fotos+txt cload instrhlp 9 1 0 ; help panel putup @fotollx+16,@fotolly+1 9 color @keycolor waitkey cfree 9 putup @txtoff,0 3 ; restore original convbox cfree 3 return ; subr INSTRHELP formerly CONVHELP ; ----------------------------------------- ; MENU_CMD -- LINK BACK TO MAIN MENU IN MASTER ; ; uses cbuf 3 (temp) ; menu_cmd: local sidemarg 3 local bottmarg 2 local rim 5 local picdim 80 local fotollx @boxllx+@rim+@sidemarg local fotolly @boxlly+@rim+@bottmarg+1 local fotourx @boxllx+@boxw-(@sidemarg+@rim+1) local fotoury @boxlly+@rim+@bottmarg+@picdim+2 local flashon 0 cgetbuf 3 @fotollx,@fotolly @fotourx,@fotoury 1 0; local txtoff (@fotollx)%8 ; boundary offset of clipping local contoff (@boxllx+417)%8 ; boundary offset of clipping color @txtboxclr rect @fotollx+1,@fotolly+1 @fotourx,@fotoury ; blank out fotos+txt cload menuwarn 1 1 0 ; help panel putup @fotollx+16,@fotolly+1 1 color @keycolor waitkey ifkey "M" menu_out m menu_out putup @txtoff,0 3 ; restore original convbox return menu_out: link master.txt @entrypoint ; END SUBR MENU_CMD ----------------------- ; ; PUSHBUTTON -- actuate onscreen "button" ; uses MS Windows button format (white #15 top line and ; 2 bars of gray #8 shading) ; ; temporarily uses cbuf 8 ; pushbutton: local llx @1 ; lower left corner of button x local lly @2 ; lower left corner y local h @3 ; height local w @4 ; width local keycolor @5 ; color of keytop ; note: uses buffer 1 local bndryoff (@llx+2)%8 ; boundary offset (@llx+2=x start of clipping) set wait "0" ; diagnostic switch cgetbuf 8 @llx+2,@lly+3 @llx+@w-3,@lly+@h-2 0 0; grab cntr of buttn color @keycolor if @wait waitkey endif line @llx+1,@lly+1 @llx+1,@lly+@h-1 ; gray out left white line line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 ; gray out top white line putup 1+@bndryoff,-1 8 color @keycolor point @llx+2,@lly+2 point @llx+@w-2,@lly+@h-2 if @wait waitkey endif putup 2+@bndryoff,-2 8 point @llx+2,@lly+1 point @llx+3,@lly+1 point @llx+@w-1,@lly+@h-2 point @llx+@w-1,@lly+@h-3 color 8 line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 color 0 line @llx+1,@lly+1 @llx+1,@lly+@h-1 if @wait waitkey endif putup 1+@bndryoff,-1 8 color 7 line @llx+2,@lly+1 @llx+@w-1,@lly+1 line @llx+@w-1,@lly+1 @llx+@w-1,@lly+@h-2 color @keycolor line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 line @llx+1,@lly+1 @llx+1,@lly+@h-1 if @wait waitkey endif cgetbuf 8 @llx+3,@lly+1 @llx+@w-1,@lly+@h-3 0 0 ; putup @bndryoff,1 8 ; new clipping from lr corner color 15 line @llx+1,@lly+1 @llx+1,@lly+@h-1 line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 color 7 point @llx+1,@lly+1 ; ll corner point @llx+@w-1,@lly+@h-1 ; tr corner if @wait waitkey endif cfree 8 return ; subr PUSHBUTTON ; ; SAY -- put speech into the conversation box ; @1 speaker (1=max,0=other) ; @2 first text string ; @3 second text string ; say: fload ibm16 color @txtboxclr rect @boxllx+94,@boxlly+9 @boxllx+394,@boxlly+89 window @boxllx+100,@boxlly+13 @boxllx+390,@boxlly+87 waitkey 50 color 0 text @2 3 text @3 3 window return ; subr SAY ; ; NEWBGRND -- installs new bgrnd and convbox ; @1 = new pic name ; @2 = new conv box llx (must be byte boundary) ; @3 = new conv box lly ; @4 = 1 => maxtalk (hilite max's box) ; @5 = 1 => install new palette ; @6 = delay between pic and convbox ; @7 = pic fade to use ; ** puts orig under convbox in buffer 2 newbgrnd: set boxllx @2 set boxlly @3 pload @1 1 if @5 palette 1 endif pfade @7 1 pfree 1 ; N.B. this code is duplicated in JUSTABOX cgetbuf 2 @boxllx,@boxlly @boxllx+@boxw,@boxlly+@boxh 1 0 ; save orig to buff 2 cload smbox3.clp 3 1 0 ; blank convbox to buffer 3 waitkey @6 ; delay before conv box putup @boxllx,@boxlly 3 ; putup conv box cfree 3 return ; subr NEWBGRND ;--------------------------------------------- beep: note 200 20 10 note 400 20 10 return; SUBR BEEP ;---------------------------------------------- ; ; JUSTABOX -- only put an instruction box ; ; @1 = boxllx ; @2 = boxlly ; cbuf2 := orig under box ; cbuf3 used temporarily ; justabox: set boxllx @1 set boxlly @2 cgetbuf 2 @1,@2 @1+@boxw,@2+@boxh 1 0 ; save orig to buff 2 cload smbox3.clp 3 1 0 ; blank convbox to buffer 3 waitkey @6 ; delay before conv box putup @1,@2 3 ; putup conv box cfree 3 return ; SUBR JUSTABOX ----------------------------------------------- ; ; DOTEXT -- write text into instruction box ; ; @1 = data block with four strings ; dotext: color 0 databegin @1 text @boxllx+@xoff1,@boxlly+@yoff1 @ text @boxllx+@xoff1,@boxlly+@yoff2 @ text @boxllx+@xoff1,@boxlly+@yoff3 @ text @boxllx+@xoff1,@boxlly+@yoff4 @ return; SUBR DOTEXT ---------------------------------------------------- ; ; DATA BLOCKS FOR TEST DRIVE ; udrv1: "First we want to find out how many bearings we have on hand." "We don't know the Part Number so we'll search through all" "bearings to find the one we want. Type %BEARING% then type" "ALT-N to get the Next (actually the first) bearing record." dataend udrv2: "The first record is the block bearing we're looking for. But" "we're out (Current Balance = 0). Maybe we can cannibalize" "non-critical equipment to get our rebuild parts. First, type" "ALT-S to drop down the Screens menu." dataend udrv3: " " "Good. Now type ALT-W to select the Where Used screen." " " " " datend udrv4: " The Where Used screen shows all uses of the bearing. Alas," " all of this equipment is vital production machinery so" " none is a candidate for cannibalization. Let's look for a " " substitute instead. Type ALT-S to drop the Screens menu." dataend: udrv5: " " "OK, now type ALT-A to bring up the Alternate Parts screen." " " " " dataend udrv6: "The Alternate Parts screen suggests the 217215A bearing. To" "determine where 217215A bearings are stored and how many we" "have we'll use the Part Locations screen. First type ALT-S" "to drop down the Screens menu." datend udrv7: " " "And then type ALT-P to bring up the Part Locations screen." " " " " dataend udrv8: "And the Parts Locations screen shows that you have one in" "your desk!" " " "This concludes the Test Drive. Please press ." datend ; END OF UDRIVE INSTRUCTION TEXT DATA BLOCKS -------------------------------------------------------